var uploadingCount = 0;
var uploadingId = "";
var waitUploadIds = new Array();
var labels;

function initPage() {
	showCount();
	loadGridTable(0);
	
	/*页码开始*/
    $(".foot").on("click",".go_left",function(){
        if($(".active").index() != 1){
            $(".active").removeClass("active").prev().addClass("active");
            loadGridTable(1);
        }else{
        	var pages = parseInt($("#pages").html());
    		var nowPage = parseInt($(".active").html());
    		if(nowPage > 6){
    			$(".active").removeClass("active");
        		$(".page_num").find(".num").each(
        			function(){
        				if($(this).index() == 6){
        					$(this).addClass("active");
        				}
        				$(this).html( parseInt($(this).html()) - 6);
        			}
        		);
        		loadGridTable(1);
    		}else if(nowPage > 1){
    			$(".active").removeClass("active");
        		$(".page_num").find(".num").each(
        			function(){
        				if($(this).index() == nowPage - 1){
        					$(this).addClass("active");
        				}
        				$(this).html( parseInt($(this).html()) - nowPage + 1);
        			}
        		);
        		loadGridTable(1);
    		}
        }
    })
    
    $(".foot").on("click",".go_right",function(){
    	if($(".active").index() != 6){
    		var pages = parseInt($("#pages").html());
    		var nowPage = parseInt($(".active").html());
    		if(nowPage < pages){
    			$(".active").removeClass("active").next().addClass("active");
        		loadGridTable(1);
    		}
    	}else{
    		var pages = parseInt($("#pages").html());
    		var nowPage = parseInt($(".active").html());
        	var leftPages = pages - nowPage;
        	if(leftPages >=6){
        		$(".active").removeClass("active");
        		$(".page_num").find(".num").each(
        			function(){
        				if($(this).index() == 1){
        					$(this).addClass("active");
        				}
        				$(this).html( parseInt($(this).html()) + 6);
        			}
        		);
        		loadGridTable(1);
        	}else if(leftPages > 0){
        		$(".active").removeClass("active");
        		$(".page_num").find(".num").each(
        			function(){
        				if($(this).index() == 7-leftPages){
        					$(this).addClass("active");
        				}
        				$(this).html( parseInt($(this).html()) + leftPages);
        			}
        		);
        		loadGridTable(1);
        	}
    	}
    })
    
    $(".foot").on("click",".num",function(){
        $(this).addClass("active").siblings().removeClass("active");
        loadGridTable(1);
    })

	    
	//加载标签
	$.ajax({
		type:"post",
		url:__webroot__+"other/attrCacheAction!query.htm?attrId=49",
		success:function(data){
			if(data != null && data.data != null){
				labels = data.data.baseAttrEnums;
			}
		}
	});
	
	//绑定上传封面事件
	$(".page-content").on("change","#fileCoverImage",function(){
		var main_page = $(this).parent().parent().parent().parent().parent();
		if($("#uploadImageForm").length == 0) {
			var form = $('<form id="uploadImageForm" enctype="multipart/form-data" method="post">');
	        form.attr("action", "fileUpload");
	        typeof ($(this).attr("name")) == 'undefined' ? $(this).attr("name", 'inputFile') : '';
	        $(this).wrap(form);
	        var option = {
	            beforeSubmit: function (formData, jqForm, options) {
	            },
	            success: function (responseText, statusText, xhr, form) {
	            	var obj = $.parseJSON(responseText);
	            	
	            	if(obj.success){
	            		var frontCoverOrder = 0;
	            		var coverImages = main_page.find(" #cover_img input");
	            		
	            		for(var i=0;i<coverImages.length;i++){
	            			if(!main_page.find("#checkbox_"+i).is(":checked")){
	            				frontCoverOrder = i;
	            				break;
	            			}
	            		}
	            		
	            		main_page.find("#frontCover").attr("src","source/"+obj.files[0]);
	            		main_page.find("#frontCover").attr("data-order",frontCoverOrder);
	            		main_page.find("#checkbox_"+frontCoverOrder).prop("checked",true);
	            		
	            		var imageList = main_page.find("#cover_img img");
        				imageList[frontCoverOrder].setAttribute('data-id',"");
        				imageList[frontCoverOrder].src = "source/"+obj.files[0];
	            	}
	            		
	            	$(this).val(null);
	            }
	        }
	        $('#uploadImageForm').ajaxForm(option);
		}
		
		$("#uploadImageForm").submit();
    });
}

function uploadCoverImage(obj){
	$(obj).parent().parent().find("#fileCoverImage").click();
}

function saveData(obj) {
	var defaultImage = "./images/edit/img.png";
	var aid = $(obj).parent().parent().parent().parent().find("#_id").val();
	
	var id = $("#edit_"+ aid + " input[id='id']").val();
	var name = $("#edit_"+ aid + " input[id='name']").val();
	var description = $("#edit_"+ aid + " textarea[id='description']").val();
	var displayType = $("#edit_"+ aid + " input[id='displayType']").val();
	var isPrivate = $("#edit_"+ aid + " input[id='isPrivate']").val();
	var mediaLevel = $("#edit_"+ aid + " input[id='mediaLevel']").val();
	var recommendation = $("#edit_"+ aid + " input[id='recommendation']").val();
	var videoUrl = $("#edit_"+ aid + " input[id='filepath']").val();
	var videoChangeFlag = $("#edit_"+ aid + " input[id='videoChangeFlag']").val();
	var frontImgOrderId = $("#edit_"+ aid + " #frontCover").attr("data-order");
	var imglist = $("#edit_"+ aid + " #cover_img img");
	var imgUrls = "";
	var imgIds = "";
	
	if(name == null || name.trim() == ""){
		alert("标题不能为空");
		return;
	}
	if(displayType == null || displayType.trim() == ""){
		alert("分类不能为空");
		return;
	}
	if(isPrivate == null || isPrivate.trim() == ""){
		alert("隐私设置不能为空");
		return;
	}
	if(description == null || description.trim() == ""){
		alert("简介不能为空");
		return;
	}
	
	if(frontImgOrderId != ""){//重新选择了封面
		var checked = $("#edit_"+ aid + " #checkbox_"+frontImgOrderId).is(':checked');
		if(!checked){
			alert("封面不在所选配图中,请重新选择配图");
			return;
		}
	}

	var recommendation = "";
	$("#edit_"+ aid + " #m_tag").find("span").each(function(){
			recommendation += ","+$(this).attr("value");
    });
	recommendation = recommendation.substr(1);
	
	for(var i=0;i<imglist.length-1;i++){
		var index = imglist[i].src.indexOf(__webroot__);
		if(index > -1) {
			var imgPath = imglist[i].src.substr(index + __webroot__.length);
			
			var checked = $("#edit_"+ aid + " #checkbox_"+i).is(':checked');
			if(imgPath != defaultImage && checked){
				imgUrls += imgPath  + ";"
			}else{
				imgUrls += " ;"
			}
			
			var imgId = imglist[i].attributes['data-id'].nodeValue;
			if(imgId == "" || imgId == null){
				imgId = "0";
			}
			imgIds += imgId  + ";";
		}
		
	}
	
	var data = {"assetApply.id":id,"assetApply.name":name,"assetApply.description":description,"assetApply.displayType":displayType
			,"assetApply.isPrivate":isPrivate,"assetApply.mediaLevel":mediaLevel,"assetApply.assetLabelApply.recommendation":recommendation
			,"assetApply.imgUrl":imgUrls,"imgIds":imgIds,"videoUrl":videoUrl,"videoChangeFlag":videoChangeFlag,"frontImgOrderId":frontImgOrderId};
	
	$.ajax({
		type:"post",
		url:__webroot__+"mam/saveContent.htm",
		data:data,
		success:function(data){
			if(data.success == true){
				if(id == ""){
					$("#edit_"+ aid + " input[id='id']").val(data.assetApply.id);
					$("#edit_"+ aid + " input[id='assetId']").val(data.assetApply.assetId);
					$("#edit_"+ aid + " #createTime").html(data.assetApply.createTime +"  采编完成");
					$("#edit_"+ aid +" #createTime").css('color','#666');
				}
				
				$("#edit_"+aid+" #is_rev").css('color','#666');
				$("#edit_"+aid+" #is_rev").html("已保存修改");
				
				if(1 == videoChangeFlag){
					$("#edit_"+ aid + " input[id='mediaLevel']").val(data.assetMediaApply.realResolution);
				}
				
				var imglist = $("#edit_"+ aid + " #cover_img img");
				for(var i=0;i<imglist.length -1;i++){
					if(Object.keys(data.assetApply.fields).length - 1 >= i){
						var imgInfo = data.assetApply.fields[i].split("#");
						imglist[i].setAttribute('data-id',imgInfo[0]);
						imglist[i].setAttribute('src',"store/asset"+imgInfo[1]);
						$("#edit_"+ aid + " #checkbox_"+i).attr('checked',true);
					}else{
						imglist[i].setAttribute('data-id',"");
						imglist[i].setAttribute('src',"./images/edit/img.png");
						$("#edit_"+ aid + " #checkbox_"+i).attr('checked',false);
					}
				}
				
				alert(data.msg);
			}else{
				alert(data.msg);
			}
		}
	});
}

/*废弃*/
function discardEdit() {
	var ids = ""; 
	$('#new_grid').find('input[type=checkbox]').each(function(){ 
		if($(this).is(':checked')){
			ids += "," + $(this).val(); 
		}
	}); 
	
    if (ids.length == 0) {
    	alert("请至少选择一条记录");
    } else {
    	if(confirm("确定要废弃吗？")){
        	$.ajax({
        		type:"post",
        		url:__webroot__+"mam/discardContentEdit.htm",
        		data:{"ids":ids},
        		success:function(data){
        			if(data.success == true){
        				alert("废弃成功");
        				loadGridTable(0);
        			}else{
        				alert(data.msg);
        			}
        		}
        		,error:function(){
        			alert("废弃失败");
        		}
        	});
    	}
    }  
} 

function showOrHidden(type,obj){
	var id = $(obj).parent().parent().parent().find("#_id").val();
	var aid = $("#edit_"+ id + " input[id='id']").val();
	console.log("id:"+id+",aid:"+aid);
	if(type == 1 && aid == ""){
		$.ajax({
			type:"post",
			url:__webroot__+"mam/queryAssetApplyByAid.htm",
			data:{"aid":id},
			success:function(data){
				if(data.success == true){
					console.log(data.assetApply);
					$("#edit_"+ id + " input[id='id']").val(data.assetApply.id);
					$("#edit_"+ id + " input[id='assetId']").val(data.assetApply.assetId);
					$("#edit_"+ id + " input[id='name']").val(data.assetApply.name);
					var assetLabelApply = data.assetApply.assetLabelApply;
					if(assetLabelApply != null && assetLabelApply.recommendation != null){
						var recommendation = assetLabelApply.recommendation.split(",");
						var myTag = $("#edit_"+ id + " #m_tag");
						for(var i=0;i<recommendation.length;i++){
							for(var j=0;j<labels.length;j++){
								if(labels[j].id == recommendation[i]){
									myTag.append("<span class='tag_node text-center' value='"+labels[j].id+"'><span>");
						        	myTag.children().last().text(labels[j].attrValue).append("<img src='./images/caibian/tab_icon_close.png'/>");
						        	break;
								}
							}
						}
						$("#edit_"+ id + " input[id='recommendation']").val(data.assetApply.assetLabelApply.recommendation);
					}
					if(data.assetMediaApply != null){
						$("#edit_"+ id + " input[id='filepath']").val(data.assetMediaApply.spath);
						$("#edit_"+ id + " input[id='mediaLevel']").val(data.assetMediaApply.realResolution);
					}
					$("#edit_"+ id + " textarea[id='description']").val(data.assetApply.description);
					$("#edit_"+ id + " input[id='displayType']").val(data.assetApply.displayType);
					$("#edit_"+ id + " input[id='_displayType']").val(data.assetApply.displayName);
					if(data.assetApply.isPrivate){
						$("#edit_"+ id + " input[id='_isPrivate']").val("隐私");
					}else{
						$("#edit_"+ id + " input[id='_isPrivate']").val("公开");
					}
					$("#edit_"+ id + " input[id='isPrivate']").val(data.assetApply.isPrivate);
					
					if(data.assetApply.frontImagePath != null && data.assetApply.frontImagePath != ""){
						$("#edit_"+ id + " #frontCover").attr("src","store/asset" + data.assetApply.frontImagePath);
					}
					
					var imgUrl = data.assetApply.imgUrl;
					var imglist = $("#edit_"+ id + " #cover_img img");
					var img =  imgUrl.split(";");
					for(var i=0;i<img.length;i++){
						if(img[i] != null && img[i] != "null" && img[i].length > 0 && i<imglist.length - 1){
							imglist[i].src = "store/asset" + img[i];
							imglist[i].setAttribute('data-id',data.assetApply.fields[i]);
							
							$("#edit_"+ id + " #checkbox_"+i).prop('checked',true);
						}
					}
				}
				
				$("#edit_" + id + " .part2").css('display','block');
				$(obj).html("收起编辑");
			}
		}); 
		
		$("#edit_" + id + " #cover_img img").bind("dblclick",function(){         
			if($(this).attr("src") == "./images/edit/img.png"){
				return;
			}
			
			var orderId = $(this).attr("data-order");
			$("#edit_"+id+ " #smallFrontCover").attr("src",$(this).attr("src"));
			$("#edit_"+id+ " #frontCover").attr("src",$(this).attr("src"));
			$("#edit_"+id+ " #frontCover").attr("data-order",orderId);
			$("#edit_"+ id + " #checkbox_"+orderId).prop('checked',true);
		});
	}else{
		if($("#edit_" + id + " .part2").is(":hidden")){
			 $("#edit_" + id +" .part2").css('display','block');
			 $(obj).html("收起编辑")
		 }else{
			 $("#edit_"+id+" .part2").css('display','none');
			 $(obj).html("展开编辑")
		 }
	}
	
	$(obj).next().toggleClass("disabled");
}

function submitByAid(obj) {
	var id = $(obj).parent().parent().parent().find("#_id").val();
	var assetId = $("#edit_"+ id + " input[id='assetId']").val();
	if(assetId == ""){
		alert("请先保存信息!");
		return;
	}
	
	if(confirm("确定要提交审核吗？")){
		$.ajax({
    		type:"post",
    		url:__webroot__+"mam/submitByAid.htm",
    		data:{"assetId":assetId,"action":"71"},
    		success:function(data){
    			if(data.success == true){
    				alert("提交审核成功");
    				loadGridTable(0);
    			}else{
    				alert(data.msg);
    			}
    		},
    		error:function(){
    			if (window.console){
    				alert("提交审核失败");
	        	}
    		}
    	});
	}
} 

function submitAll(){
	var assetIds = ""; 
	
	$('#new_grid').find('input[type=checkbox]').each(function(){ 
		if($(this).is(':checked')){
			var id = $(this).val(); 
			assetIds += $("#edit_"+ id + " input[id='assetId']").val() + ",";
		}
	}); 
	
	console.log(assetIds);
	
	if (assetIds.length == 0) {
		alert("请至少选择一条记录");
	} else {
		if(confirm("确定要提交审核吗？")){
			$.ajax({
				url: __webroot__ + 'mam/submitAll.htm',
				data: {assetIds:assetIds,"action":"71"},
				type: 'post',
				success: function(response){
					var successResultBean = response.successResult;
					var failResultBean = response.failResult;
					//成功的返回信息
					var successMsg = "提交成功的媒资信息\n";
					var j = 0;
					if(!empty(successResultBean)){
						for(var i = 0; i < successResultBean.length; i++){
							successMsg += "媒资Id:" + successResultBean[i].returnObject.assetId + "\n";
							j = j + 1;
						}
					}
					var successMsg1 = successMsg + "成功个数:" + j;
					var failMsg = "\n提交失败的媒资信息\n";
					var k = 0;
					if(!empty(failResultBean)){
						for(var i = 0; i < failResultBean.length; i++){
							failMsg += "媒资Id:" + failResultBean[i].returnObject.assetId + "  " + "错误信息:" + failResultBean[i].msg + "\n";
							k = k + 1;
						}
					}
					alert(successMsg1 + failMsg1);
					loadGridTable(0);
				}
			});
	    }
	} 
}

function newUploadVideo(){
	var datetime = new Date().getTime();
	var newDivId = createNewDiv(datetime);
	h5UploadVideo(newDivId,0,datetime);
}

function createNewDiv(dt){
	var html = $("#create_grid").html();
	html = html.replace("$(assetAid)",dt);
	html = html.replace("$(assetAid)",dt);
	$("#new_grid").prepend(html);
	
	return "edit_" + dt;
}

function uploadVideo(obj) {
	var id = $(obj).parent().parent().parent().parent().find("#_id").val();
	h5UploadVideo("edit_"+id,id,0);
};

function h5UploadVideo(divId,aid,dt){
	$("#"+divId).zyCloudUpload({
		dt				 :   dt,
		aid				 :	 aid,
		url              :   __webroot__+"fileUpload",			  // 上传文件的路径
		multiple         :   false,                    // 是否可以多个文件上传
		dragDrop         :   true,                    // 是否可以拖动上传文件
		del              :   true,                    // 是否可以删除文件
		finishDel        :   false,  				  // 是否在上传文件完成后删除预览
		/* 外部获得的回调接口 */
		filterFile: function(files){
			// 选择文件的回调方法
			var arrFiles = [];  // 替换的文件数组

			for (var i = 0, file; file = files[i]; i++) {
				if (file.type.indexOf("audio")==-1 && file.type.indexOf("video")==-1) {
					alertmsg('warning', '您这个"'+ file.name +'"不是音视频文件');	
				} else {
					// 在这里需要判断当前所有文件中
					arrFiles.push(file);	
				}
			}
			return arrFiles;
		},
		onSelect: function(files, allFiles){                    // 选择文件的回调方法
			uploadingCount ++;
			
			//没有正在上传是文件,上传该文件;有正在上传是文件,加入等待上传文件列表
			if(uploadingCount == 1){
				if(aid == 0){//新增
					uploadingId = dt;
				}else{
					uploadingId = aid;
				}
				
				$("#edit_"+uploadingId+" button[id='fileSubmit']").click();
			}else{
				if(aid == 0){//新增
					waitUploadIds.push(dt);
				}else{
					waitUploadIds.push(aid);
				}
			}
			
			if(aid == 0){
				$("#edit_"+dt+" #progress").css('display','block');
				$("#edit_"+dt+" #rejectReason").css('display','none');
			}else{
				$("#edit_"+aid+" #progress").css('display','block');
				$("#edit_"+aid+" #rejectReason").css('display','none');
			}
		},
		onDelete: function(file, surplusFiles){                     // 删除一个文件的回调方法
		},
		onProgress: function(file, loaded, total) {
			var eleProgress = $("#edit_"+uploadingId+" div[id='uploadProgress']"), percent = (loaded / total * 100).toFixed(0) + '%';
			eleProgress.css("width",percent);
			if(percent == "100%"){
				$("#edit_"+uploadingId+" span[id='progressInfo']").html("上传成功"+percent);
				$("#edit_"+uploadingId+" .play").css('display','block');
			}else{
				$("#edit_"+uploadingId+" span[id='progressInfo']").html("上传"+percent);
			}
		},
		onSuccess: function(file, response){                    // 文件上传成功的回调方法
			var obj = $.parseJSON(response);
        	var path = obj.files[0];
        	file.path = path;
        	
        	if(uploadingCount > 1){
    			uploadingId = waitUploadIds.shift();
    			$("#edit_"+uploadingId+" button[id='fileSubmit']").click();
        	}
        	uploadingCount--;
        	
        	$("#edit_"+ uploadingId + " input[id='filepath']").val(path);
        	$("#edit_"+ uploadingId + " input[id='videoChangeFlag']").val("1");
        	
        	pumpingFrame(uploadingId);
        	
        	if(aid == 0){//新增视频,绑定双击图片选择封面事件
    			$("#edit_"+uploadingId+ " #cover_img img").bind("dblclick",function(){         
    				if($(this).attr("src") == "./images/edit/img.png"){
    					return;
    				}
    				
    				$("#edit_"+uploadingId+ " #smallFrontCover").attr("src",$(this).attr("src"));
    				$("#edit_"+uploadingId+ " #frontCover").attr("src",$(this).attr("src"));
    				$("#edit_"+uploadingId+ " #frontCover").attr("data-order",$(this).attr("data-order"));
    			});
        	}
		},
		onFailure: function(file){                    // 文件上传失败的回调方法
			
		},
		onComplete: function(responseInfo){           // 上传完成的回调方法
			
		}
	});
}

//换一换配图
function changeCoverImage(obj){
	var id = $(obj).parent().parent().parent().parent().parent().find("#_id").val();
	pumpingFrame(id);
}

//抽帧
function pumpingFrame(id){
	var choosenImgCount = 0;
	var imglist = $("#edit_"+ id + " #cover_img img");
	var imgCount = imglist.length - 1;
	for(var i=0;i<imgCount;i++){
		var checked = $("#edit_"+ id + " #checkbox_"+i).is(':checked');
		if(checked){
			choosenImgCount ++;
		}
	}
	
	if(choosenImgCount >= imgCount){
		return;
	}
	
	var pumpingFrameNum = imgCount - choosenImgCount;
	var path = $("#edit_"+ id + " #filepath").val();
	
	$.ajax({
		url: __webroot__ + 'mam/pumpingFrame.htm',
		data: {"videoPath":path,"nums":pumpingFrameNum},
		type: 'post',
		success: function(data){
			if(data.success){
				var times = 0;
				var timerId = setInterval(function(){
					 
					console.log("times:"+times);
					
					var existCount = 0;
					var existArray = new Array();
					for(var i=0;i<pumpingFrameNum;i++){ //循环为每个img设置
						if (checkImageExist("source/"+data.imgs[i])) { 
							existArray.push(data.imgs[i]);
							existCount++; 
						}
					}
					
					for(var i=0;i<imgCount;i++){
						var checked = $("#edit_"+ id + " #checkbox_"+i).is(':checked');
						if(!checked && existArray.length > 0){
							imglist[i].src = "source/"+existArray.pop();
							imglist[i].setAttribute('data-id',"");
						}
					}
					
					if(existCount == pumpingFrameNum || times >= 10){//抽帧图片都生成成功
						clearInterval(timerId); 
					} 
					
					times++;   
				},3000);
			}
		}
	});
} 

//判断抽帧后拿到的图片是否存在
function checkImageExist(imgUrl){
	var imgObj = new Image();
	imgObj.src = imgUrl;  
	if (imgObj.width > 0 && imgObj.height > 0) {  
		return true;  
	} else {  
		return false;
	} 
}

function formatDuration(duration){
	var second = duration%60;
	var minute = parseInt(duration/60)%60;
	var hour = parseInt(duration/3600);
	if(hour > 0){
		return hour + ":" + minute + ":" + second;
	}else{
		return minute + ":" + second;
	}
}

function loadGridTable(type){
	var limit = 5;
	var page = parseInt($(".active").html());
	$.ajax({
		url : __webroot__ + "mam/queryAssetApply.htm",
		data : {"flag":"edit","rows":limit,"page":page},
		type: 'post',
		success: function(response){
			var newPages = Math.ceil(response.records/limit);
			$("#pages").html(newPages);
			if(type == 0){//重新加载页面
				$("#page_num_list").html("");
				
				$("#page_num_list").append('<label class="btn btn-sm btn-white go_left"><</label>');
				$("#page_num_list").append('<label class="btn btn-sm num active">'+1+'</label>');
				for(var i=2;i<=6&&i<=newPages;i++){
					$("#page_num_list").append('<label class="btn btn-sm num">'+i+'</label>');
				}
				$("#page_num_list").append('<label class="btn btn-sm btn-white go_right">></label>');
			}
			
			$("#new_grid").html("");
			for(var i=0;i<response.rows.length;i++){
				var newHtml = $("#init_gird").html();
				var aid = response.rows[i]['id'];
				var eachHtml = newHtml.replace("$(assetAid)",aid);
				eachHtml = eachHtml.replace("$(assetAid)",aid);
				eachHtml = eachHtml.replace("$(assetId)",response.rows[i]['assetId']);
				eachHtml = eachHtml.replace("$(assetName)",response.rows[i]['name']);
				eachHtml= eachHtml.replace("$(createTime)",response.rows[i]['createTime']);
				eachHtml= eachHtml.replace("$(rejectReason)",response.rows[i]['rejectReason'] == null?"":response.rows[i]['rejectReason']);
				eachHtml= eachHtml.replace("$(duration)",formatDuration(response.rows[i]['cduration']));
				
				if( response.rows[i]['frontImagePath'] != null && response.rows[i]['frontImagePath'] != ""){
					eachHtml= eachHtml.replace("./images/caibian/img.png","store/asset" + response.rows[i]['frontImagePath']);
				}
				$("#new_grid").append(eachHtml);
				if(response.rows[i]['finished']){
					$("#edit_"+aid+" #is_rev").css('color','#666');
					$("#edit_"+aid+" #is_rev").html("已保存修改");
				}else{
					$("#edit_"+aid+" #is_rev").css('color','red');
					$("#edit_"+aid+" #is_rev").html("信息未修改");
				}
			}
		}
	});
}